﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
using xbUI;

public class DialogManager : MonoBehaviour
{
    [SerializeField] private Dialog1 dialog1;

    public static DialogManager Instance
    {
        get;
        private set;
    }

    void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else
        {
            Destroy(gameObject);
        }
    }

    public GameObject ShowDialog1(string _content, string _title = "错误", OnConfirm _callfunc = null)
    {
        GameObject box1 = dialog1.gameObject;
        box1.GetComponent<Dialog1>().SetCallfunc(_callfunc);
        box1.GetComponent<Dialog1>().Title = _title;
        box1.GetComponent<Dialog1>().Content = _content;
        box1.SetActive(true);
        return box1;
    }
}
